<!DOCTYPE html>
<html>
  <head>
    <title>丝路商城</title>
    <%= stylesheet_link_tag    'application' %>
    <%= javascript_include_tag 'application' %>
    <%= csrf_meta_tags %>
  </head>

  <body>
    <% if current_user.present? %>
      <nav class="navbar navbar-fixed-top" role="navigation" style="background-color: #428bca; border-color: #428bca;">
        <div class="container-fluid">
          <div>
            <ul class="nav navbar-nav" style='float:left;'>
              <li class="<%= yield(:edit_users_on) %>">
                <%= link_to "丝路乐购新疆商城后台", root_path, :style=>"color:#ffffff;font-size:20px;font-weight: bold;" %>
              </li>
            </ul>

            <ul class="nav navbar-nav">

              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:#ffffff;">
                  操作<b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                  <li><a href="<%= root_path %>">关于我们</a></li>
                  <li><a href="<%= users_path %>">后台用户管理</a></li>
                  <li><a href="<%= customers_path %>">h5顾客管理</a></li>
                  <li><a href="<%= member_users_path %>">pc端顾客管理</a></li>
                  <li><a href="<%= monitor_logs_path %>">操作日志</a></li>
                </ul>
              </li>

              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:#ffffff;">
                  商品<b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                  <li><a href="<%= goods_path %>">商品管理</a></li>
                  <li><a href="<%= first_categories_path %>">商品一级分类管理</a></li>
                  <li><a href="<%= categories_path %>">商品二级分类管理</a></li>
                  <li><a href="<%= comments_path %>">商品评论管理</a></li>
                </ul>
              </li>

              <!--
                <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:#ffffff;">
                订单<b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                </ul>
                </li>
              -->

              <li>
                <a href="<%= orders_path %>" style="color:#ffffff;">订单管理</a>
              </li>

              <li class="">
                <a href="<%= user_addresses_path %>" style="color:#ffffff;">收货地址管理</a>
              </li>
            </ul>

            <ul class="nav navbar-nav" style='float:right'>
              <li class="<%= yield(:user) %>">
                <%= link_to "欢迎您: #{current_user.try :email}", root_path, :style=>"color:#ffffff;" %></li>
              <li>
                <%= link_to '退出', destroy_user_session_path, :method => :delete, :style=>"color:#ffffff;" %>
              </li>
            </ul>
          </div>
        </div>
      </nav>

      <div class="locbar navbar-fixed-top" style='z-index:10;top: 10px; left: 9%'>
        您现在的位置：<%= yield :locbar %>
    </div>
  <% end %>

  <div class="container" style="margin-top: 100px;z-index: -3;margin-bottom:50px;">
    <!--
    <% if notice_message.present? %>
      <p class="messages" style=" background: #dff0d8;"><%= notice_message %></p>
    <% end %>
    -->

    <%= yield %>
  </div>

  <!-- 全局弹出层 -->
  <div id="modal-ajax" class="modal hide fade" tabindex="-1"></div>

  <%= render '/layouts/messages' %>

  <div style="text-align: center;background-color: #dff5fe;bottom: 0px;position: fixed;width:100%;height:30px;padding:5px;">
    版权所有  <a href="#" target="_blank">丝路乐购</a> ©2017
  </div>
  </body>

  <style>
.dropdown-submenu {
  position: relative;
}

    .dropdown-submenu>.dropdown-menu {
      top: 0;
      left: 100%;
      margin-top: -6px;
      margin-left: -1px;
      -webkit-border-radius: 0 6px 6px 6px;
      -moz-border-radius: 0 6px 6px;
      border-radius: 0 6px 6px 6px;
    }

    .dropdown-submenu:hover>.dropdown-menu {
      display: block;
    }

    .dropdown-submenu>a:after {
      display: block;
      content: " ";
      float: right;
      width: 0;
      height: 0;
      border-color: transparent;
      border-style: solid;
      border-width: 5px 0 5px 5px;
      border-left-color: #ccc;
      margin-top: 5px;
      margin-right: -10px;
    }

    .dropdown-submenu:hover>a:after {
      border-left-color: #fff;
    }

    .dropdown-submenu.pull-left {
      float: none;
    }

    .dropdown-submenu.pull-left>.dropdown-menu {
      left: -100%;
      margin-left: 10px;
      -webkit-border-radius: 6px 0 6px 6px;
      -moz-border-radius: 6px 0 6px 6px;
      border-radius: 6px 0 6px 6px;
    }
  </style>

  <script>
$(function(){
  $('table').addClass('table table-hover table-striped table-bordered')
})
$('.dropdown-submenu ul').hide();

$('.multi-level li > a').hover(
    function () {
      //show its submenu
      $(this).parent().children('ul').stop().slideDown(100);
    }
    );
$('.multi-level li').hover(null,
    function (e) {
      //hide its submenu
      $(this).children('ul').stop().slideUp(100);
    }
    );
  </script>

</html>
